package com.sort;

/**
 * @author yijy
 * @description
 * @create 2021/3/21 下午4:04
 **/
public class ArrNums {

    public static void main(String[] args) {
        int m =3;
        int n =4;
        int[][] mn = new int[m][n];
        int[][] mn1 = {{1,4,7,10},{0,2,3,5}};
        mn[0] = new int[] {1,4,7,10};
        mn[1] = new int[] {0,2,3,5};
        mn[2] = new int[] {3,6,8,11};
        int[] mergeArr = new int[m*n];
        //记录排序过的数组索引位
        int index_0 = 0;
        int index_1 = 0;
        int index_2 = 0;
        int index_merArr = 0;
        while (index_0 < n & index_1 <n & index_2 < 0){

            for(int i=0; i<m; i++){
                int temp0 = mn[index_0][i];
                int temp1 = mn[index_1][i];
                int temp2 = mn[index_2][i];
                if(temp0 <= temp1 && temp0 <= temp2){
                    mergeArr[index_merArr] = temp0;
                    index_0 ++;

                }
                if(temp1 <= temp0 && temp1 <= temp2){
                    mergeArr[index_merArr] = temp0;
                    index_1 ++;
                }

                if(temp2 <= temp0 && temp2 <= temp1){
                    mergeArr[index_merArr] = temp0;
                    index_2 ++;
                }
                index_merArr ++;
            }

        }

    }

}
